//package wrappers;

public class Number implements FunctionInterface {
    Integer value = 0;
    boolean defined = false;

    public Number(int v) {
        value = v;
        defined = true;
    }

    @Override
    public Object getValue() {
        return value;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public FunctionInterface run() {
        return this;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void add(Object f) {
        if (defined)
            return;
        if (f instanceof Integer) {
            value = (Integer) f;
            defined = true;
        }
    }
}
